home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / wais / ui / document.h < prev    next >
C/C++ Source or Header  |  1995-05-09  |  2KB  |  73 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE:
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.
  4.  
  5.    This is part of the user-interface for the WAIS software.  Do with it
  6.    as you please.
  7.  
  8.    jonathan@Think.COM
  9.  *
  10.  * $Log:    document.h,v $
  11.  * Revision 1.2  92/03/17  14:37:32  jonathan
  12.  * Cleaned up for use with X interface as well.
  13.  * Prototyped everything.
  14.  * 
  15.  *
  16.  */
  17.  
  18. #ifndef _H_DOCUMENT
  19. #define _H_DOCUMENT
  20.  
  21. #include <docid.h>
  22. #include "source.h"
  23.  
  24. typedef struct CRetDocument
  25.  { 
  26.    /* instance variables */
  27.    DocID *id;
  28.    SourceID sourceID;
  29.    any*            myConnection;                /* really a ConnectionID but circular includes preclude that */
  30.    long             numLines;                    /* number of lines in document */
  31.    long             numChars;                   /* number of characters */
  32.    char         *blocks,*pendingBlocks;     /* lists of CLineBlocks */
  33.    long             best;
  34.    char        *source,*headline,*city,*stock,*company,*industry, **type, *date;
  35.    struct CRetDocument     *next,*prev;                 /* linked docs if there are any */
  36.    char            *paraStarts;                    /* i'th paragraph starts at line paraStarts[i] 
  37.                                                       -1 terminated 
  38.                                                     */
  39.    
  40.  } _CRetDocument, *CRetDocument;
  41.  
  42. typedef struct DocumentID {
  43.   short rawScore, normalScore;
  44.   long start, end;
  45.   CRetDocument doc;
  46. } _DocumentID, *DocumentID;
  47.  
  48. typedef struct doclist {
  49.   DocumentID thisDoc;
  50.   struct doclist *nextDoc;
  51. } _DocList, *DocList;
  52.  
  53. /* functions */
  54.  
  55. void freeItemList _AP((char** list));
  56. char **buildDocumentItemList _AP((DocList doclist, Boolean scorep));
  57. DocList ReadListOfDocuments _AP((FILE* file));
  58. short ReadFragment _AP((FILE* file, long* dest));
  59. short ReadDoc _AP((FILE* file, CRetDocument doc));
  60. short ReadDocument _AP((DocumentID doc, FILE* file));
  61. CRetDocument MakeNewDocument _AP((void));
  62. DocList makeDocList _AP((DocumentID doc, DocList rest));
  63. DocumentID copy_docid _AP((DocumentID doc));
  64. void WriteDocument _AP((DocumentID doc, FILE* fp));
  65. void sort_document_list _AP((DocList dlist));
  66. DocList findLast _AP((DocList dlist));
  67. DocumentID findDoc _AP((DocList dlist, int number));
  68. DocumentID fillDocumentID _AP((WAISDocumentHeader* docHeader,SourceID source));
  69. void freeDocumentID _AP((DocumentID doc));
  70. void freeDocList _AP((DocList doclist));
  71.  
  72. #endif
  73.